Skip to content

Conversation

nbbeeken
Copy link
Collaborator

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

@github-actions github-actions bot added the fix label Aug 22, 2025
@nbbeeken nbbeeken added the no release notes Fix or feature not for release notes label Aug 22, 2025
@nbbeeken nbbeeken marked this pull request as ready for review August 22, 2025 18:05
@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 18:05
@nbbeeken nbbeeken requested a review from a team as a code owner August 22, 2025 18:05
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors the logger implementation to replace PassThrough stream with a custom Writable stream object for better control over log handling in the CompassWebLogger class.

  • Replaces PassThrough stream with a custom Writable-like object that directly handles write and end operations
  • Simplifies the logging pipeline by removing intermediate stream handling
  • Maintains the same callback functionality for log processing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@nbbeeken nbbeeken requested a review from syn-zhu August 22, 2025 18:07
});
const target = {
write(line: string, callback: () => void) {
callbackRef.current.onLog?.(JSON.parse(line));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to update the test ensure it's happening synchronously?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added one!

Comment on lines +1646 to +1654
log.info(
mongoLogId(1_001_000_005),
'Compass Connection Attempt Started',
'Connection attempt started',
{
clusterName: connectionInfo.atlasMetadata?.clusterName,
connectionId: connectionInfo.id,
}
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@syn-zhu On line 1583, there is log 1_001_000_004 that carries the same info, is there a significance to this logs position over that one?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

related to my response to your next comment: Our purpose for introducing these logs was to facilitate connection latency tracking with Sentry. Given that, I wanted to reduce the surface area to connection attempts that would actually be meaningful.

@syn-zhu syn-zhu requested a review from Anemy August 26, 2025 00:23
@syn-zhu
Copy link
Collaborator

syn-zhu commented Aug 26, 2025

There is one task failing, but it fails even on main: https://github.com/mongodb-js/compass/actions/runs/17210696051

Looks like it's been flaky for a while. Everything else is passing and I've addressed all comments, so gonna go ahead and merge this.

@syn-zhu syn-zhu merged commit c6eff56 into main Aug 26, 2025
125 of 130 checks passed
@syn-zhu syn-zhu deleted the CLOUDP-332732 branch August 26, 2025 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix no release notes Fix or feature not for release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants